package tests;

import java.util.ArrayList;
import java.util.ListIterator;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import tools.XmlParserUtility;

public class TestXML {

	public static void main(String[] args) {
		XmlParserUtility xp = new XmlParserUtility();
		Document dom = xp.ReadXMLFile("dict.xml");
		ArrayList<Element> al = (ArrayList<Element>) xp.ParseXMLDocument(
				"word", dom);
		// Element el = null;

		ListIterator<Element> litr = al.listIterator();
		while (litr.hasNext()) {
			Element el = litr.next();
			System.out.println("EngWord = " + xp.getTextValue(el, "en")
					+ ", FrenchWord = " + xp.getTextValue(el, "fr")
					+ ", Count = " + xp.getTextValue(el, "count"));

		}
	}
}
